import request from "../utils/request.js";

const Token = window.token || process.env.VUE_APP_TOKEN || "";
const url = "/BXPortal/BXInterface/AppInterface.ashx";

// 获取数据方法
function getdata(Method, method, Data) {
  return request({
    url,
    method,
    params: {
      Method,
      Json: JSON.stringify({
        Token,
        Data,
      }),
    },
    hideloading: true,
  });
}

// 功能列表
export const Pad_GetApplicationCenter = (data = {}) =>
  getdata("Pad_GetApplicationCenter", "post", data);

// 扫码报修-设备扫码获取设备详细信息
export const Pad_EquipmentScanCode = (
  data = {
    EquipmentNoDes: "",
  }
) => getdata("Pad_EquipmentScanCode", "post", data);

// 扫码报修-获取部门
export const Pad_EquipmentGetWorkType = (data = {}) =>
  getdata("Pad_EquipmentGetWorkType", "post", data);

// 扫码报修-获取车间
export const Pad_EquipmentGetWorkName = (
  data = {
    MaintainWorkType: "",
  }
) => getdata("Pad_EquipmentGetWorkName", "post", data);

// 扫码报修-获取设备
export const Pad_EquipmentGetFailures = (
  data = {
    MaintainWorkType: "",
    MaintainWorkName: "",
  }
) => getdata("Pad_EquipmentGetFailures", "post", data);

// 扫码报修-获取故障类型
export const Pad_EquipmentGetFailure = (
  data = {
    EquipmentNo: "",
    kwd: "",
  }
) => getdata("Pad_EquipmentGetFailure", "post", data);

// 扫码报修-发起报修
export const Pad_EquipmentPost = (
  data = {
    EquipmentID: "",
    FaultType: [],
    UrgentTask: 0,
    Remarks: "",
  }
) => getdata("Pad_EquipmentPost", "post", data);

// 任务分配-获取列表
export const Pad_Repair_GetDistributionTask = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
    StartDate: "",
    EndDate: "",
  }
) => getdata("Pad_Repair_GetDistributionTask", "post", data);

// 任务分配-获取维修人员
export const Pad_Repair_GetSubordinateUser = (
  data = {
    RepairId: "",
  }
) => getdata("Pad_Repair_GetSubordinateUser", "post", data);

// 任务分配-分配任务
export const Pad_Repair_AssignmentTask = (
  data = { TaskId: "", TaskAccount: "" }
) => getdata("Pad_Repair_AssignmentTask", "post", data);

// 个人信息-个人信息详细
export const Pad_PersonalInformation = (data = {}) =>
  getdata("Pad_PersonalInformation", "post", data);

// 个人信息-打开或关闭是否开工按钮
export const Pad_SetStart = (
  data = {
    Type: "",
  }
) => getdata("Pad_SetStart", "post", data);

// 个人信息-个人信息详细
export const Pad_SetMessagePush = (
  data = {
    Type: "",
  }
) => getdata("Pad_SetMessagePush", "post", data);

// 扫码签到-获取报修详细
export const Pad_EquipmentGetInfo = (
  data = {
    EquipmentNoDes: "",
  }
) => getdata("Pad_EquipmentGetInfo", "post", data);

// 扫码签到-确认签到
export const Pad_ScanCodeSignIn = (
  data = {
    RepairId: "",
  }
) => getdata("Pad_ScanCodeSignIn", "post", data);

// 报修单订单详细
export const Pad_Repair_GetRepairInfo = (
  data = {
    RepairId: "",
  }
) => getdata("Pad_Repair_GetRepairInfo", "post", data);

// 待处理-获取列表
export const Pad_Repair_GetRepairResponse = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
    StartDate: "",
    EndDate: "",
  }
) => getdata("Pad_Repair_GetRepairResponse", "post", data);

// 任务移交-获取当前报修单下所有的报修人员
export const Pad_Repair_GetAllRepairMember = (
  data = {
    RepairId: "",
  }
) => getdata("Pad_Repair_GetAllRepairMember", "post", data);

// 任务移交-任务交接
export const Pad_Repair_HandoverTask = (
  data = {
    RepairId: "",
    Account: "",
    Remarks: "",
  }
) => getdata("Pad_Repair_HandoverTask", "post", data);

// 维修中任务-获取列表
export const Pad_Repair_GetUnderRepair = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
    StartDate: "",
    EndDate: "",
  }
) => getdata("Pad_Repair_GetUnderRepair", "post", data);

// 维修协助-获取可协助人员
export const Pad_Repair_GetStartOperation = (data = {}) =>
  getdata("Pad_Repair_GetStartOperation", "post", data);

// 维修协助-发起协助任务
export const Pad_Repair_AssistanceTask = (
  data = {
    RepairId: "",
    AssistanceUser: "",
  }
) => getdata("Pad_Repair_AssistanceTask", "post", data);

// 部品领用-已领用列表
// export const Pad_Repair_RequisitionInfo = (
//   data = { RepairId: "", Page: "", Number: "" }
// ) => getdata("Pad_Repair_RequisitionInfo", "post", data);

// 部品领用-获取部品信息
export const Pad_Repair_GetRequisition = (
  data = {
    RepairId: "",
    Page: "",
    Number: "",
    仓库名称: "",
    物料代码: "",
    物料名称: "",
    规格型号: "",
    描述: "",
  }
) => getdata("Pad_Repair_GetRequisition", "post", data);

// 部品领用-领用物品
export const Pad_Repair_AddRequisition = (
  data = {
    RepairId: "",
    Requisitions: [],
  }
) => getdata("Pad_Repair_AddRequisition", "post", data);

// 维修中任务-维修完成
export const Pad_Repair_ProcessingTasks = (
  data = {
    RepairId: "",
    IsManufactor: "",
    IsPurchase: "",
    Remarks: "",
    CountermeasureType: "",
    TemporaryDate: "",
  }
) => getdata("Pad_Repair_ProcessingTasks", "post", data);

// 维修协助-协助任务列表
export const Pad_Repair_GetAssist = (
  data = {
    RepairId: "",
  }
) => getdata("Pad_Repair_GetAssist", "post", data);

// 维修协助-完成协助
export const Pad_Repair_FinishAssistTask = (
  data = {
    RepairId: "",
    TaskId: "",
  }
) => getdata("Pad_Repair_FinishAssistTask", "post", data);

// 维修记录任务列表
export const Pad_Repair_GetRepairResponseAll = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
    StartDate: "",
    EndDate: "",
  }
) => getdata("Pad_Repair_GetRepairResponseAll", "post", data);

// 永久对策-获取列表
export const Pad_Repair_TemporaryCountermeasureList = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
    StartDate: "",
    EndDate: "",
  }
) => getdata("Pad_Repair_TemporaryCountermeasureList", "post", data);

// 永久对策-完成对策
export const Pad_Repair_CompCounTask = (
  data = {
    RepairId: "",
    Remarks: "",
  }
) => getdata("Pad_Repair_CompCounTask", "post", data);

// 永久对策-完成对策
export const Pad_MyTaskYJDC = (
  data = {
    RepairId: "",
    Remarks: "",
  }
) => getdata("Pad_MyTaskYJDC", "post", data);


// 资料查询-获取列表
export const Pad_Repair_GetUserGuideInfo = (
  data = {
    RepairId: "",
    Page: "",
    Number: "",
    KeyWords: "",
  }
) => getdata("Pad_Repair_GetUserGuideInfo", "post", data);

// 维修履历-获取列表
export const Pad_Repair_GetMaintenanceResumeInfo = (
  data = {
    RepairId: "",
    MaintainWorkName: "",
    EquipmentLine: "",
    FailureType: "",
    StartDate: "",
    EndDate: "",
    Page: "",
    Number: "",
    KeyWords: "",
  }
) => getdata("Pad_Repair_GetMaintenanceResumeInfo", "post", data);

// 流程
export const Pad_MyTaskWXBGS = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
  }
) => getdata("Pad_MyTaskWXBGS", "post", data);

export const Pad_MyTaskYQCJXZ = (
  data = {
    Page: "",
    Number: "",
    KeyWords: "",
  }
) => getdata("Pad_MyTaskYQCJXZ", "post", data);